import request from '@/utils/request.js';
import {download, toFormData} from '@/utils/common.js';


/**
 * 获取年级
 * @returns {Promise<any>}
 */
export async function getGrade() {
  const res = await request.get('/admin/school/degree/selectlist');
  if (res.data.code === 200) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

/**
 * 获取系别
 * @returns {Promise<any>}
 */
export async function getDepartment() {
  const res = await request.get('/admin/school/degree/department/selectlist');
  if (res.data.code === 200) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

/**
 * 获取专业
 * @returns {Promise<any>}
 */
export async function getMajor() {
  const res = await request.get('/admin/school/degree/major/selectlist');
  if (res.data.code === 200) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

/**
 * 获取用户
 * @returns {Promise<any>}
 */
export async function getUser() {
  const res = await request.get('/system/admin/normal/selectlist');
  if (res.data.code === 200) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}
